Optimal. Leaf size=115 \[ -\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {a^2 \sec ^2(c+d x)}{d}-\frac {4 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec ^4(c+d x)}{4 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {b^2 \tan ^6(c+d x)}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 131, normalized size of antiderivative = 1.14, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 962}
\begin {gather*} \frac {\left (a^2-2 b^2\right ) \sec ^4(c+d x)}{4 d}-\frac {\left (2 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec ^5(c+d x)}{5 d}-\frac {4 a b \sec ^3(c+d x)}{3 d}+\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \sec ^6(c+d x)}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 962
Rule 3970
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^2 \tan ^5(c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x} \, dx,x,b \sec (c+d x)\right )}{b^4 d}\\ &=\frac {\text {Subst}\left (\int \left (2 a b^4+\frac {a^2 b^4}{x}-b^2 \left (2 a^2-b^2\right ) x-4 a b^2 x^2+\left (a^2-2 b^2\right ) x^3+2 a x^4+x^5\right ) \, dx,x,b \sec (c+d x)\right )}{b^4 d}\\ &=-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {\left (2 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {4 a b \sec ^3(c+d x)}{3 d}+\frac {\left (a^2-2 b^2\right ) \sec ^4(c+d x)}{4 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {b^2 \sec ^6(c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 105, normalized size = 0.91 \begin {gather*} \frac {-60 a^2 \log (\cos (c+d x))+120 a b \sec (c+d x)+30 \left (-2 a^2+b^2\right ) \sec ^2(c+d x)-80 a b \sec ^3(c+d x)+15 \left (a^2-2 b^2\right ) \sec ^4(c+d x)+24 a b \sec ^5(c+d x)+10 b^2 \sec ^6(c+d x)}{60 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 148, normalized size = 1.29
method | result | size |
derivativedivides | \(\frac {\frac {b^{2} \left (\sin ^{6}\left (d x +c \right )\right )}{6 \cos \left (d x +c \right )^{6}}+2 b a \left (\frac {\sin ^{6}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{6}\left (d x +c \right )}{15 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{6}\left (d x +c \right )}{5 \cos \left (d x +c \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}\right )+a^{2} \left (\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(148\) |
default | \(\frac {\frac {b^{2} \left (\sin ^{6}\left (d x +c \right )\right )}{6 \cos \left (d x +c \right )^{6}}+2 b a \left (\frac {\sin ^{6}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{6}\left (d x +c \right )}{15 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{6}\left (d x +c \right )}{5 \cos \left (d x +c \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}\right )+a^{2} \left (\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(148\) |
risch | \(i a^{2} x +\frac {2 i a^{2} c}{d}+\frac {4 b a \,{\mathrm e}^{11 i \left (d x +c \right )}-4 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+\frac {28 b a \,{\mathrm e}^{9 i \left (d x +c \right )}}{3}-12 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+\frac {104 b a \,{\mathrm e}^{7 i \left (d x +c \right )}}{5}-16 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+\frac {20 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{3}+\frac {104 b a \,{\mathrm e}^{5 i \left (d x +c \right )}}{5}-12 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+\frac {28 b a \,{\mathrm e}^{3 i \left (d x +c \right )}}{3}-4 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 b a \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}-\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(248\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 108, normalized size = 0.94 \begin {gather*} -\frac {60 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {120 \, a b \cos \left (d x + c\right )^{5} - 80 \, a b \cos \left (d x + c\right )^{3} - 30 \, {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 24 \, a b \cos \left (d x + c\right ) + 15 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 10 \, b^{2}}{\cos \left (d x + c\right )^{6}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 5.05, size = 115, normalized size = 1.00 \begin {gather*} -\frac {60 \, a^{2} \cos \left (d x + c\right )^{6} \log \left (-\cos \left (d x + c\right )\right ) - 120 \, a b \cos \left (d x + c\right )^{5} + 80 \, a b \cos \left (d x + c\right )^{3} + 30 \, {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - 24 \, a b \cos \left (d x + c\right ) - 15 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 10 \, b^{2}}{60 \, d \cos \left (d x + c\right )^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.81, size = 189, normalized size = 1.64 \begin {gather*} \begin {cases} \frac {a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 a b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{5 d} - \frac {8 a b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{15 d} + \frac {16 a b \sec {\left (c + d x \right )}}{15 d} + \frac {b^{2} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{6 d} - \frac {b^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{6 d} + \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{6 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right )^{2} \tan ^{5}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 341 vs.
\(2 (107) = 214\).
time = 1.92, size = 341, normalized size = 2.97 \begin {gather*} \frac {60 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 60 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {147 \, a^{2} + 128 \, a b + \frac {1002 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {768 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2925 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1920 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {4140 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {1280 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {640 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2925 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {1002 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {147 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{6}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.97, size = 215, normalized size = 1.87 \begin {gather*} \frac {2\,a^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d}+\frac {\frac {32\,a\,b}{15}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (12\,a^2+32\,b\,a\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+\frac {64\,b\,a}{5}\right )+12\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (20\,a^2+\frac {64\,a\,b}{3}-\frac {32\,b^2}{3}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________